#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<bitset>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for(int i = (a);i <= (b);++i)
#define per(i,a,b) for(int i = (a);i >= (b);--i) 
#define mkp std::make_pair
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;
inline bool cmp(int x,int y){return x < y;}
/* -fsanitize=undefined  */
const int N = 1e5+9;
const int p = 1e9+7;
const double eps = 1e-7;
int _,n,a[2*N];
char ch[N];
ll nxt[2*N],pre[2*N],t,ans,last;

inline ll _pow(ll x,int po){
    ll anss = 1;
    while(po){
        if(po&1) anss = (anss * x) % p;
        x = (x*x) % p;
        po >>= 1;
    }
    return anss % p;
}

inline ll f(int now){
    if(now == 0) return 0;
    else return (((9*now-1)%p)*(_pow(10,now)%p))%p + 1;
}

int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #ifdef LOCAL //  -DLOCAL
        freopen("i n.in", "r", stdin);
    #endif
    cin >> ch+1;
    n = strlen(ch+1);
    rep(i,1,n) a[i] = ch[i] - '0';

    for(ll i= 1;i <= n;++i){
        last = ans;
        ans = (ans + (((a[i])%p) * ( f(n-i)%p )*123456791)%p + (((i-1)*i/2)%p) * a[i]*_pow(10,n-i))%p;
    }
    cout << (ans)%p << "\n";

    return 0;
}